package ex.tableapi;

import org.apache.flink.table.api.Table;

import static org.apache.flink.table.api.Expressions.$;

public class EXSelect extends ApiFrame {
    private String outName = "printOutTable";

    public static void main(String[] args) {
        EXSelect demo = new EXSelect();
        demo.getEnv();
        Table orders = demo.registerMysql("myorder", "orders");

        Table result = demo.exSelect(orders);

        demo.registerConsole(demo.createPrintOutDDL(result.getResolvedSchema().toString()), demo.outName);
        result.executeInsert(demo.outName);
    }

    private Table exSelect(Table orders) {
        orders.printSchema();
//        Table result1 = orders.select($("a"), $("c").as("g"));
        Table result = orders.select($("*"));
        return result;
    }


}

